// logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    logs: []
  },
  goback() {
    wx.navigateBack({
      delta: 1,
    })
  },
  onLoad(options) {
    let page = options.page || '';
    let data = options.data || '';
    let key = options.key || '';
    console.log(decodeURIComponent(key));
    this.setData({
      page,//相当于page:page
      data
    })
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return {
          date: util.formatTime(new Date(log)),
          timeStamp: log
        }
      })
    })
  }
})
